package com.A21.GuoSai.demo.service_entity.entity.atom;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class VarPojo {

   //原子服务Id
   protected Integer atomId;
   //原子服务名
   protected String atomName;
//   //变量的value
//   protected Object value;
   //变量的类型
   protected Class<?> typeClass;

   protected String type;

   protected Boolean isPreConnect=false;

   protected Boolean isLastConnect=false;
//   参数对应的原子服务的methodInfo
   protected String methodInfo;

   //变量的描述
   protected String varDesc;


   public void setTypeClass(Class<?> typeClass) {
      this.typeClass = typeClass;
      this.type=typeClass.getCanonicalName();
   }

   public void setType(String type) {
//        this.typeClass = Class.forName(type);
      this.type=type;
      try {
         this.typeClass = Class.forName(type);
      } catch (ClassNotFoundException e) {
         e.printStackTrace();
      }
   }

   // 数据库中的type是varchar类型，所以这里的getType()也要是String类型
   // 否则后台会报type handler was null on parameter mapping for property xx的错误
}
